Working with E-Signing > E-Signing Samples |
The C# and PHP web tiers have been updated to support the needs of the form template designer and e-signer web apps. To accomplish this, two new classes were created in both web tiers:
The following public methods are available, to be used by other application code directly.
Creates a session based on a document name. This method uses the "DocumentPath" setting in the pcc.config file to look up a document by the specified name in that folder.
Returns the viewing session id as a string.
Creates a session based on a form definition. This method uses the "FormDefinitionPath" parameter in the pcc.config file to look up a form definition stored using the specified ID in that folder. Then, it will read the form definition file which contains a JSON object with a "templateDocument" property. That property’s value is a document name that can be looked up in the folder specified by "DocumentPath" in the same pcc.config file.
Returns the viewing session id as a string.
Creates a session based on an existing Stream object (such as a file stream) and a file extension defined as a string.
Returns the viewing session id as a string.
The following URL mappings are exposed, to be used as an HTTP API.
Uses "fromDocumentName" in order to create a viewing session.
Responses:
200
Example |
Copy Code
|
---|---|
{
"viewingSessionId": {viewingSessionId}
}
|
Uses "fromFormDefinition" in order to create a viewing session.
Responses:
200
Example |
Copy Code
|
---|---|
{
"viewingSessionId": {viewingSessionId}
}
|
Returns a list of all definitions on the server.
Responses:
200 OK
Example |
Copy Code
|
---|---|
[ { "name" {string}: the name of the form definition (as assigned by the user) "formDefinitionId" {string}: a unique ID for that particular resource }, { "name": "Time Off Request", "formDefinitionId": "guid" }, {...} ] |
580 Server Error
Example |
Copy Code
|
---|---|
{ "errorCode" {string}: "ServerError", "errorMessage" {string}: a useful message about what happened, such as a file read error "formDefinitionId": {formDefinitionId} If a form definition file could not be parsed, it’s ID will be displayed here. } |
Returns a specific form definition.
Responses:
200 OK
Example |
Copy Code
|
---|---|
JSON data for FormDefinition
|
404 Not Found
Example |
Copy Code
|
---|---|
None |
580 Server Error
Example |
Copy Code
|
---|---|
{ "errorCode": "ServerError", "errorMessage" {string}: "A useful error message about the server error." "formDefinitionId": {formDefinitionId} } |
Creates a new form definition, as defined in the request body.
Body:
Example |
Copy Code
|
---|---|
JSON data for FormDefinition
|
Responses:
201 Created
Example |
Copy Code
|
---|---|
{ "formDefinitionId": "guid" } |
580 Server Error
Example |
Copy Code
|
---|---|
{ "errorCode" {string}: "ServerError", "errorMessage" {string}: exception message, "formDefinitionId": {formDefinitionId} } |
Updates an existing form definition.
Body:
Example |
Copy Code
|
---|---|
JSON data for FormDefinition
|
Responses:
200 OK
Example |
Copy Code
|
---|---|
None |
404 Not Found
Example |
Copy Code
|
---|---|
None |
580 Server Error
Example |
Copy Code
|
---|---|
{ "errorCode" {string}: "ServerError", "errorMessage" {string}: exception message, "formDefinitionId": {formDefinitionId} } |
Request Headers:
Example |
Copy Code
|
---|---|
X-HTTP-Method-Override: DELETE |
Deletes a form definition from storage. Note: the implementation allows for this to be an actual DELETE verb, if supported.
Body:
Example |
Copy Code
|
---|---|
None |
Responses:
204 No Content
Example |
Copy Code
|
---|---|
None |
404 Not Found
Example |
Copy Code
|
---|---|
None |
580 Server Error
Example |
Copy Code
|
---|---|
{ "errorCode" {string}: "ServerError", "errorMessage" {string}: exception message, "formDefinitionId": {formDefinitionId} } |
Example |
Copy Code
|
---|---|
{ "templateDocumentId" {string}: "I-9 Form.pdf", "globalSettings" {object}: { "signatureDateFormat" {string}: "MM/DD/YYYY" }, "formDefinitionId" {string}: "04a6032f3eaa4a8a9eb1b5fce1cb99e9", "formName" {string}: "Form I-9", "formData" {array}: [ { "fieldId" {string}: "Text1", "template" {string}: "TextTemplate", "rectangle" {object}: { "width" {number}: 162.21070234113716, "height" {number}: 14.839464882943162, "x" {number}: 39.91304347826082, "y" {number}: 179.0969899665552 }, "pageNumber" {number}: 1, "sortIndex" {number}: 1, "fontName" {string}: "Fira Sans", "fontColor" {string}: "#000000", "displayName" {string}: "Last Name", "required" {boolean}: true, "characterLimit" {number}: 0, "pageData" {object}: { "width" {string}: 612, "height" {string}: 792 } } ] } |